function err = df_check(N,P,MAT,f,u)
  g = MAT*u; 
  e = f-g;
  err = norm(e(:))/norm(f(:));
